$OpenBSD: patch-src_openvpn_tun_c,v 1.4 2015/06/25 08:46:49 sthen Exp $
--- src/openvpn/tun.c.orig	Mon Jun  8 07:16:35 2015
+++ src/openvpn/tun.c	Thu Jun 25 09:38:54 2015
@@ -944,7 +944,19 @@ do_ifconfig (struct tuntap *tt,
 			  );
 	}
       else
-	argv_printf (&argv,
+      {
+        if (tt->topology == TOP_SUBNET)
+          argv_printf (&argv,
+                              "%s %s %s %s netmask %s mtu %d up",
+                              IFCONFIG_PATH,
+                              actual,
+                              ifconfig_local,
+                              ifconfig_local,
+                              ifconfig_remote_netmask,
+                              tun_mtu
+                              );
+        else
+	  argv_printf (&argv,
 			  "%s %s %s netmask %s mtu %d broadcast %s link0",
 			  IFCONFIG_PATH,
 			  actual,
@@ -953,6 +965,7 @@ do_ifconfig (struct tuntap *tt,
 			  tun_mtu,
 			  ifconfig_broadcast
 			  );
+      }
       argv_msg (M_INFO, &argv);
       openvpn_execve_check (&argv, es, S_FATAL, "OpenBSD ifconfig failed");
       if ( do_ipv6 )
@@ -971,6 +984,18 @@ do_ifconfig (struct tuntap *tt,
 	  add_route_connected_v6_net(tt, es);
 	}
       tt->did_ifconfig = true;
+
+      /* Add a network route for the local tun interface */
+      if (!tun && tt->topology == TOP_SUBNET)
+        {
+          struct route_ipv4 r;
+          CLEAR (r);
+          r.flags = RT_DEFINED;
+          r.network = tt->local & tt->remote_netmask;
+          r.netmask = tt->remote_netmask;
+          r.gateway = tt->local;
+          add_route (&r, tt, 0, NULL, es);
+        }
 
 #elif defined(TARGET_NETBSD)
 
